//
//  CTTableViewCell.m
//  PT
//
//  Created by jarze on 15/6/11.
//  Copyright (c) 2015年 jarze. All rights reserved.
//

#import "CTTableViewCell.h"
#import "MeItem.h"
#import "LabelItem.h"
#import "NextItem.h"
#import "MyMessageItem.h"
#import "MyBillItem.h"
#import "CTTableViewCellView.h"

@interface CTTableViewCell()

@property (nonatomic, weak) UILabel *labelView;
@property (nonatomic, strong) CTTableViewCellView *teacherView;
@end
@implementation CTTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

//- (UILabel *)labelView
//{
//    if (_labelView == nil) {
//        _labelView = [[UILabel alloc] init];
//        
//        CGRect frame = CGRectMake(self.frame.size.width-40, 0, 40, self.frame.size.height);
//        
//        _labelView.frame = frame;
//        _labelView.text = self.LabelItem.label;    }
//    return _labelView;
//}



- (void)layoutSubviews
{
    
    [super layoutSubviews];
}


+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *ID = @"CTCell";
    
   CTTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier: ID];
    if (cell == nil) {
        cell = [[CTTableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier: ID];
    }
    
    return cell;
    
}


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if(self) {
        
        CTTableViewCellView *teacherView = [[CTTableViewCellView alloc]init];
        [self.contentView addSubview:teacherView];
        _teacherView = teacherView;
        self.backgroundColor = [UIColor whiteColor];
        
    }
    
    return self;

}


- (void)setMeItem:(MeItem *)meItem
{
    _meItem = meItem;

    [_teacherView setMeItem:meItem];
    if ([_meItem isKindOfClass:[NextItem class]]) {
                self.accessoryType =  UITableViewCellAccessoryDisclosureIndicator;
        
    }
}
@end
